{template header}
<script src="{$staticHost}js/ColorPicker.js"></script>
<style type="text/css">
   .label-in-control {float: left;padding-top: 5px;text-align: right;width: 50px;}
   .label-in-control input {width: 50px;}
   .control-in-controls {margin-left: 70px;padding-top: 5px;}
   .control-in-controls input {width: 500px;}
</style>
<script type="text/javascript">
    $(document).ready(function(){
      $(".arrow-down").click(function(){
        var thisClick = $(this).parents(".control-group");
        var nextDiv = thisClick.next();
        if(nextDiv.html() == undefined)
        {
          alert('stop!\n这已经是我的底限了！');
        }
        else {
          nextDiv.after(thisClick);
        }
      });
      $(".arrow-up").click(function(){
        var thisClick = $(this).parents(".control-group");
        var prevDiv = thisClick.prev();
        if(prevDiv.html() == undefined)
        {
          alert('海到无边天作岸\n山登绝顶我为峰\n第一名，so easy!');
        }
        else {
          prevDiv.before(thisClick);
        }
      });
    });
</script>
<form class="form-horizontal" action="index.php?c=admin&a=setGearHmBest" method="post" enctype="multipart/form-data">
  {loop $list $k $v}
  <div class="control-group">
    <label class="control-label">尖货：</label>
    <div class="controls">
      <label class="label-in-control">标题：</label>
      <div class="control-in-controls">
        <input type="text" name="content[]" placeholder="标题" value="{$v['title']['content']}">
        <span class="btn arrow-up">&nbsp;&nbsp;up&nbsp;&nbsp;</span><i class="icon-circle-arrow-up"></i>
      </div>
      <label class="label-in-control">色值：</label>
      <div class="control-in-controls">
        <input type="text" id="color_{$k}" name="color[]" placeholder="请选择色值" value="{$v['title']['color']}">
        <script>CreateCPBtn('color_{$k}');</script>
      </div>
      <label class="label-in-control">描述：</label>
      <div class="control-in-controls">
        <input type="text" name="describe[]" placeholder="请描述信息" value="{$v['describe']}">
        <span class="btn arrow-down">down</span><i class="icon-circle-arrow-down"></i>
      </div>
      <label class="label-in-control">图片：</label>
      <div class="control-in-controls">
        <img src="{$v['img']}" width="100" />
        <input type="hidden" name="img[]" placeholder="图片" value="{$v['img']}">
        <input type="file" name="imgNew_{$k}">
      </div>
      <label class="label-in-control">链接：</label>
      <div class="control-in-controls">
        <input id="url" type="text" name="url[]" value="{$v['url']}">
        <input id="sorder" name="sorder[]" type="hidden" value="{$k}">
      </div>
    </div>
  </div>
  {/loop}
  <div class="control-group">
    <div class="controls">
        <button type="submit" class="btn">提交</button>
    </div>
  </div>
</form>
{template footer}